home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / OpenTptGlobalNew.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-13  |  887 b   |  55 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        OpenTptGlobalNew.h
  3.  
  4.     Contains:    Open Transport's GlobalNew.h function
  5.  
  6.     Copyright:    © 1994-1995 by Apple Computer, Inc., all rights reserved.
  7.  
  8.  
  9. */
  10.  
  11. #ifndef __OPENTPTGLOBALNEW__
  12. #define __OPENTPTGLOBALNEW__
  13.  
  14. #ifndef SystemSevenOrLater
  15. #define SystemSevenOrLater    1
  16. #endif
  17.  
  18. #ifndef __CONDITIONALMACROS__
  19. #include <ConditionalMacros.h>
  20. #endif
  21. #ifndef __STDDEF__
  22. #include <StdDef.h>
  23. #endif
  24.  
  25. #if GENERATING68K && defined(__MWERKS__)
  26. #pragma pointers_in_D0
  27. #endif
  28.  
  29. extern "C" 
  30. {
  31.     extern void*     OTAllocMem(size_t);
  32.     extern void        OTFreeMem(void*);
  33. }
  34.  
  35. #if GENERATING68K && defined(__MWERKS__)
  36. #pragma pointers_in_A0
  37. #endif
  38.  
  39. inline void* operator new(size_t size)
  40. {
  41.     return OTAllocMem(size);
  42. }
  43.  
  44. inline void* operator new(size_t size, size_t extra)
  45. {
  46.     return OTAllocMem(size + extra);
  47. }
  48.  
  49. inline void operator delete(void* theMem)
  50. {
  51.     OTFreeMem(theMem);
  52. }
  53.     
  54. #endif    /* __OPENTPTGLOBALNEW__ */
  55.